Method, apparatus and computer readable medium for building muti-tier flash cache by using spare flash drives

ABSTRACT

Embodiments of the present disclosure provide a method for establishing a multi-tier flash cache using spare drives. In some embodiments, there is provided a computer-implemented method, comprising: in response to receiving an I/O request, determining whether there is a free page in a main cache; in response to determining that there is no free page in the main cache, establishing a secondary cache by selecting at least one spare drive from spare drives; flushing data from a cold page in the main cache to the secondary cache, an access frequency of the cold page being lower than a predetermined threshold; and writing data related to the I/O request from a persistent storage device to the cold page.

RELATED APPLICATIONS

This application claim priority from Chinese Patent Application Number CN201710250534.3, filed on Apr. 17, 2017 at the State Intellectual Property Office, China, titled “METHOD, APPARATUS AND COMPUTER READABLE MEDIUM FOR BUILDING MULTI-TIER FLASH CACHE BY USING HOT-SPARE FLASH DRIVES” the contents of which is herein incorporated by reference in its entirety.

FIELD

Embodiments of the present disclosure generally relate to data storage, and more specifically, to method, apparatus and computer-readable medium for building multi-tier flash cache by using spare drives.

BACKGROUND

In the disk array, there are generally two kinds of cache in the block layer, namely Dynamic Random-Access Memory (DRAM) cache and Solid-State Disk (SSD) cache. The DRAM cache has the quickest response to data requests; however it is restricted in costs and cache capacity. The SSD cache responds to data requests only second to the DRAM cache, and has different degrees of relatively lower cost and higher cache capacity than DRAM.

The HDD disk is typically used to store all user data and it responds to I/O request that cannot be responded by the DRAM cache and the SSD cache. The HDD disk has the slowest response time, open capacity and lowest cost per GB.

In the current product, depending on the RAID type of the RAID group, the hard disk manager reserves one or more disks as a spare disk. These spare disks are prepared to replace the failed disk when the disk in the RAID group fails. Most of the time, these spare disks are not used. It is very wasteful for some expensive SSDs.

SUMMARY

Embodiments of the present disclosure aim to provide a solution for establishing a multi-tier flash cache using spare drives.

In a first aspect to the present disclosure, there is provided a computer-implemented method. The method comprises: in response to receiving an I/O request, determining whether there is a free page in a main cache of cache; in response to determining that there is no free page in the main cache, establishing a secondary cache by selecting at least one spare drive from spare drives in a storage pool; flushing data from a cold page in the main cache to the secondary cache, an access frequency of the cold page being lower than a predetermined threshold; and writing data related to the I/O request from a persistent storage device to the cold page.

In a second aspect of the present disclosure, there is provided an electronic apparatus. The apparatus comprises: at least one processor; and a memory coupled to the at least one processor and comprising instructions stored thereon, wherein the instructions, when executed by the at least one processor, cause the apparatus to perform acts including: in response to receiving an I/O request, determining whether there is a free page in a main cache of cache; in response to determining that there is no free page in the main cache, establishing a secondary cache by selecting at least one spare drive from spare drives in a storage pool; flushing data from a cold page in the main cache to the secondary cache, an access frequency of the cold page being lower than a predetermined threshold; and writing data related to the I/O request from a persistent storage device to the cold page

In a third aspect of the present disclosure, there is provided a computer-readable medium having instructions stored with thereon which, when executed by at least one processing unit, causing the at least processing unit to be configured to execute a method comprising: in response to receiving an I/O request, determining whether there is a free page in a main cache of cache; in response to determining that there is no free page in the main cache, establishing a secondary cache by selecting at least one spare drive from spare drives in a storage pool; flushing data from a cold page in the main cache to the secondary cache, an access frequency of the cold page being lower than a predetermined threshold; andwriting data related to the I/O request from a persistent storage device to the cold page.

The Summary is provided to introduce the selections of concepts in a simplified way, which will be further explained in the following detailed descriptions of the embodiments. The Summary bears no intention of identifying key or vital features of the present disclosure or limiting the scope of the present disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

Through the following detailed description with reference to the accompanying drawings, the above and other objectives, features, and advantages of example embodiments of the present disclosure will become more apparent. In the drawings, several example embodiments of the present disclosure will be illustrated by way of example but not limitation, in which:

FIG. 1 illustrates a schematic diagram of a traditional cache layer in a disk array;

FIG. 2 illustrates a schematic diagram of an embodiment of a traditional flash cache;

FIG. 3 illustrates a schematic diagram of an overall cache architecture according to embodiments of the present invention;

FIG. 4 illustrates a flowchart of a method 400 for establishing a multi-tier flash cache according to embodiments of the present disclosure;

FIG. 5 shows a schematic diagram of establishing the first tier in the secondary cache according to the embodiments of the present disclosure;

FIG. 6 demonstrates a schematic diagram of cache architecture of establishing the multi-tier flash cache according to embodiments of the present disclosure;

FIG.7 illustrates a schematic diagram of write cache hit on the secondary cache according to embodiments of the present disclosure;

FIG. 8 illustrates a schematic diagram of removing one cache device from the secondary cache according to embodiments of the present disclosure;

FIG. 9 illustrates a block diagram of a device 900 for establishing a multi-tier flash cache according to embodiments of the present disclosure; and

FIG. 10 illustrates a schematic block diagram of an apparatus 1000 suitable for implementing embodiments of the present disclosure.

In each drawing, same or corresponding signs refer to same or corresponding parts.

DETAILED DESCRIPTION OF EMBODIMENTS

In the following text, each exemplary embodiment of the present disclosure will be described with reference to the drawings. It should be noted that the drawings and description relate to exemplary embodiments only. It is pointed out that substitution embodiments of the structure and method disclosed herein can be easily contemplated based on the following description, and the substitution embodiment can be utilized without deviating from the principles protected by the present disclosure.

It should be appreciated that the exemplary embodiments are merely to enable those skilled in the art to better understand and further implement the present disclosure and is not intended for limiting the scope of the present disclosure in any manner.

As used herein, the term “comprises”, “comprises” and similar terms are to be read as open-ended terms, i.e., “comprises/comprises, but is not limited to.” The term “based on” is to be read as “based at least in part on.” The term “one example embodiment” is to be read as “at least one example embodiment.” The term “a further embodiment” is to be read as “at least one further embodiment.” Related defmitions of other terms will be provided in the following description.

In the disk array, here are generally two kinds of cache in the block layer, namely Dynamic Random-Access Memory (DRAM) cache and Solid-State Disk (SSD) cache. The advantage of DRAM is that requests for data can be responded quickly, for example, typically around 60 μs. However, DRAM cache costs are high, and there are certain hardware limitations in the DRAM cache capacity. The SSD cache has a request response speed to data that is second only to the DRAM cache, and is typically 1 ms, for example. Depending on SLC/MLC/TLC technology, the SSD cache has a relatively low degree of cost compared to DRAM. Meanwhile, in terms of cache capacity, the SSD cache is usually higher than the DRAM cache. SSDs can have, for example, the following types according to different technologies: HE SSD, MESSD and LE SSD. SSDs of different technologies have different characteristics, for example, HE SSDs have the highest number of writes/day up to 30 writes/day, and LE SSDs only have less than 5 writes/day of writes/day.

In addition, HDD disks are typically used to store all user data and respond to I/O request that cannot be responded by the DRAM cache and the SSD cache. The HDD disk has the slowest response time, open capacity and lowest cost per GB.

FIG. 1 illustrates a schematic diagram of a traditional cache layer in the disk array. The traditional cache normally comprises a DRAM cache, an SSD cache and a Hard Disk Drive (HDD). As shown in FIG. 1, the DRAM cache 110 is positioned at the top of the I0 data path, and the SSD cache 120 is below the DRAM cache 110 while the HDD matrix 130 is under the SSD cache. When the disk array receives a host I/O request, there are two types of cache hits: the first one is the DRAM cache 110 hit, that is, the DRAM cache 110 first searches its cached data; if the search of the DRAM cache 110 is hit, the DRAM cache 110 will, for example, use the data to respond the host request. The second is SSD cache 120 hit, that is, no corresponding data is found in the DRAM cache 110, then the DRAM cache 110 forwards the I/O request to the SSD cache 120, which searches its own cached data after receiving the forwarded I/O request. If the search of the SSD cache 120 is hit, the SSD cache 120 will, for example, use the data to respond the host request. If no corresponding data is found in the SSD cache 120, the I/O request is forwarded by the SSD cache 120 to the HDD matrix 130.

FIG. 2 illustrates a schematic diagram of an embodiment of the traditional SSD cache.

In the current product, the SSD cache is designed as a read/write cache. To provide a higher reliability, the SSD cache consists of a pair of SSD disks, which is called a cache device. For the sake of description, the reference sign 120 representing the cache SSD in FIG. 1 is still used in FIG. 2. As shown in FIG. 2, the SSD cache 120 comprises device 210, device 210 ₁, device 210 ₂, and device 210 ₃. The devices each consists of a pair of SSD disks, wherein each pair of SSD disks is formed as an RAID 1 group, which ensures that no data is loss when an SSD disk is offline or damaged. Each cache device is divided into metadata logic unit and user data logic unit. In FIG. 2, the portion of each pair of SSDs that being schematically identified by slashes is user data logic unit and the portion of each pair of SSDs that being not identified by slashes is metadata logical unit..

The SSD disk technology needs to support over 25 w/day. Therefore, if the ME SSD is used in the fast cache, it is required that 50% space is reserved to satisfy the demand. Such structure wastes the usage of the flash disk and increases user costs when most host I/O are read I/O.

Further, in the prior art, the hard disk manager will reserve one or more disks as spare drives depending on the RAID type of the RAID groups. These spare drives are prepared for replacing failed disk when the disk in the RAID group fails. In most time, these spare drives are not used. It is very wasteful for the expensive ME/LE/RI type of SSD disks.

Accordingly, a solution that can effectively improve the utilization of spare disks and system efficiency is requested.

FIG. 3 illustrates a schematic diagram of an overall cache architecture according to embodiments of the present invention. As shown in FIG. 3, the RAID manager 340 comprises an SSD cache 350 and an HDD 360. The HDD 360 also comprises an HDD spare drive 370. In the SSD cache 350, two different types of SSD disks are shown. One is an HE/ME type SSD disk and the other is an LE type SSD disk. In FIG. 3, a cylinder filled with diamond lattices represents an HE/ME type SSD disk, and the cylinder filled with vertical lines represents an LE type SSD disk. Although not illustrated in the drawing, an RI (read intensive) type SSD cache may also be included in the SSD cache. The HE/ME type SSD disk has a higher number of writable times than the LE and RI type SSD disks, and the LE type SSD disk has a higher number of writable times than the RI type SSD disk.

As described above, the SSD cache usually consists of a pair of SSD disks, which is called a SSD device. For example, the SSD pair 3502 in FIG. 3 consists of two individual SSD disks 350,. It can be seen that in the HE/ME type of SSD disks, there are two pairs of SSD pairs which respectively form the device 3100 and device 310, in the flash cache 320. In one embodiment of the present disclosure, device 3100 and device 310, formed by SSD pairs, respectively, are referred to as main caches.

It should be understood that although only two main cache devices are shown in FIG. 3, which are for illustrative purposes only and not for the limitation of the number of the main cache devices. Without deviating from the concept of the present disclosure, any number of main cache devices may exist. There are corresponding types of spare disks in the HE/ME and LE types of SSD disks. The spare disks of the HE/ME and LE type SSD disks are identified by dotted boxes in FIG. 3. It can be seen that the device 310 ₂ in the flash cache 320 is formed by the HE/ME type of spare drives 3503 and the device 310 ₃ in the flash cache 320 is formed by the LE type of spare drives 350 ₄. In one embodiment of the present disclosure, the cache devices formed by the spare drive of HE/ME and LE types of SSD disks, respectively, that is, device 310 ₂ and device 310 ₃, are referred to as secondary cache.

It should be noted that although device 310 ₂ and device 310 ₃ are both secondary cache, they are not established at the same time due to the different types of SSDs forming the device 310 ₂ and the device 310 ₃. When the capacity of the main cache is insufficient, the spare disk of the type of SSD disk with the highest number of writable times is used as the first tier to establish the secondary cache, and the spare disk of the type of SSD disk with the second-high number of writable times is used as the second tier to establish the secondary cache, and so on. That is, the secondary cache is established hierarchically.

It should be noted that the main cache is a cache that supports read/write cache. In order to enable the spare drives that act as secondary cache to be available at any time by the lower hard disk management layer, the secondary cache consisting of the spare drives only has read functionality. Accordingly, the secondary cache can cache clean user data, and it is not necessary to flush them to the hard disk when the data is removed. Thus, the spare drive can be quickly released when the lower hard disk management needs them. For example, in

FIG. 3, if the SSD disk in the resource pool 330 fails, the spare disk of the same type as the failed disk will be immediately released to replace the failed disk. Unlike the main cache, which is generally an R1 RAID group, the secondary cache consists of ME/LE/RI forming an R0 RAID group, which provides hot user data with a larger cache capacity than the main cache.

In addition to being different from the main cache in terms of cache composition, the memory management allocated for the secondary cache also different. In order to be able to quickly release the resources allocated to the secondary cache, the resources are individually allocated to each device in the secondary cache, and a hash index is established for each device in the secondary device.

FIG. 4 illustrates a flowchart of a method 400 to establish a multi-tier flash cache according to embodiments of the present disclosure. FIG. 5 shows a schematic diagram of establishing the first tier in the secondary cache according to the embodiments of the present disclosure. FIG. 6 shows a schematic diagram of cache architecture of establishing the multi-tier flash cache according to embodiments of the present disclosure. The method 400 to establish a multi-tier flash cache according to embodiments of the present disclosure in FIG. 4 will be further described in details with reference to FIGS. 5 to 6.

According to general guidelines, the hot user data (the most frequently accessed user data) will be promoted from HDD to the read-write cache. For example, in FIGS. 5 and 6, the hot user data in HDD 510 is promoted to the main cache device 520 ₀, which illustratively consist of a pair of SSD disks 530. It should be understood that the main cache can comprise a plurality of pairs of SSD disks. In the case of cache hit, the user data will be written into the free pages of the main cache device 520 ₀.

As shown in FIG. 4, at 410, if the I/O request of the host is received, it is determined whether there is a free page in the main cache device 520 ₀ in the cache. As the system runs, the new user data is continuously written into the main cache device 520 ₀, and the free pages in the main cache device 520 ₀ become less. In the prior art, a page (cold page) in which the access frequency in the read-write cache is less than a predetermined threshold is generally evicted to the HDD. The repeated promotion and eviction actions reduce the service life of read-write cache.

Therefore, according to one embodiment of the present disclosure, at 420, if it is determined that there is no free page in the main cache device 520 ₀, at least one spare drive is selected to establish the secondary cache. It can be understood that the spare drive can be any one of spare drive 350 ₃ of the HE/ME type of SSD and spare drive 350 ₄ of the LE type of SSD in FIG. 3 and spare drive of the RI type of SSD not shown. In view of durability of SSD disks, when the spare drive is selected to establish the secondary cache, first select at least one of the SSD spare disks having a number of writeable times per unit time exceeding a predetermined threshold, for example, having the highest number of writeable times., to establish the first tier of the secondary cache.

It should be appreciated that the number of writable times per unit of time may be, for example, the number of writes per day (WPD). For example, the spare drive 350 ₃ of the HE/ME type of SSD in FIG. 3 can be selected to establish the secondary cache device 520 ₁ of FIG. 5, which comprises one HE/ME type of SSD disk 540. Although FIG. 3 only schematically illustrates a spare drive 350 ₃ of the HE/ME type of SSD, it should be appreciated that if there are multiple SSD spare disks of the same type, multiple spare disks may be selected to establish a secondary cache. The secondary cache devices established by the same type of SSD spare disk are at the same tier.. For example, the first tier of the secondary cache comprises two secondary cache devices 520 ₁ and 520 ₂ in FIG. 6.

It should be noted that unlike the main cache, which only has one global metadata index, the devices in the secondary cache are each allocated with respective storage space that is used to establish their respective metadata index. For example, in the disk 540 of FIG. 5, the portion not identified by the slashes represents the metadata logic unit and the portion identified by the slashes represents the user data logic unit. It should be noted that other disks in the flash cache layer of FIG. 5 and portions of the metadata logic unit of each disk in FIG. 6 to FIG. 8 to be described below will be identified in the above-described manner of identification of the disk 540 in FIG. 5. The user data logic unit is omitted for the sake of brevity in other descriptions herein.

Once the secondary cache is established, at 430, the data of the cold page evicted from the main cache device 520 ₀ is flushed to the secondary cache device 520 ₁. At 440, the data related to the I/O request, that is, hot user data above, is written into from the persistent storage device, such as the HDD, to the cold page in the above main cache.

Subsequently, if the same type of SSD spare disk does not exist in the storage pool, for example, in FIG. 3, the spare disk the spare drive 350 ₃ of the HE/ME type of SSD is already used to establish the first tier in the secondary cache device and there is no other spare disk of the same type in the storage pool. Meanwhile, In the case that there is no available capacity in the already established cache disk at this tier, at least one of the SSD spare disks of the type having the next highest number of writable times, for example, the number of writable times per unit time is equal to a predetermined threshold, is selected to establish the next tier of the secondary cache. For example, the spare disk 350 ₄ of the LE type of SSD in FIG. 3 can be selected to establish the secondary cache device 520 ₂ of FIG. 6, and the secondary cache device 520 ₂ comprises an LE type of SSD disk 550. Despite of the difference in the type with the SSD spare drive to establish the first tier of the secondary cache device, other establishing procedure is identical to the establishment of each device at the first tier of the secondary cache device, and therefore are not described here.. It should be understood that the secondary cache device 520 ₂ is also allocated with a separate storage space for establishing its metadata index.

Following the above method, the multi-tier secondary cache device is established tier by tier using different types of SSD spare drives. When the flash cache layer 560 in FIGS. 5 and 6 receives the I/O request, a page related to the requested data is first searched in the global metadata index of the main cache device. If no corresponding page is found, the metadata indexes in the secondary cache device are searched tier by tier. FIG. 7 illustrates a schematic diagram of write cache hit on the secondary cache according to the embodiments of the present disclosure. According to one embodiment of the present disclosure, in case that the cache page in the secondary cache device is hit, the flash cache layer will allocate new pages in the main cache device to write the data related to the above I/O request into new pages allocated in the main cache device while the original pages in the secondary cache device will be released. As shown in FIG. 7, when the cache page in the secondary cache device 520 ₁ (indicated by a box marked with vertical lines) is hit, data of the hit page is written into a pair of SSD disks 530 of the main cache device 520 ₀. The original pages in the disk 540 of the secondary cache device 520 ₁ are released (the released page is represented by a symbol “X”).

When the lower disk management layer needs a spare disk to replace the failed SSD

EMC-16-1165.02 disk in the storage pool and there is no available spare disk (that is, the corresponding type of spare disk is used to establish a secondary cache device), it shall notify flash cache layer to release the required type of secondary cache device FIG. 8 illustrates a schematic diagram of removing one cache device from the secondary cache according to the embodiments of the present disclosure. As shown in FIG. 8, according to one embodiment, the lower hard disk management layer first mark the metadata logic unit of the secondary device 520 ₃ as unavailable. Once the flash cache layer 360 notices that the metadata logic unit of the secondary cache device 520 ₃ is unavailable, the unavailable secondary cache device 520 ₃ is removed from the secondary cache device. According to one embodiment of the present disclosure, the storage space allocated for the secondary cache device 520 ₃ is first released, and then the user data logic unit established on the secondary cache device 520 ₃ is removed. When the lower hard disk management layer notices that all the logic units establish on the cache device have been removed, the released cache device is used to replace the failed SSD disk. Because according to the solution of the present disclosure, the secondary cache can only cache the clean user data, it is not necessary to flush them to the hard disk when these data are removed. Therefore, the cache device can be quickly released when the lower hard disk management needs them.

During a system restart due to a failure, the cache layer will load the database that was recorded in the cache configuration to set up the cache. The database records the metadata logic unit, the user data logic unit, the cache device of the main cache and the cache device of the secondary cache. The difference between the main cache and the secondary cache is the number of disks included in their cache devices.. One cache device in the main cache comprises two disks while one cache device in the secondary cache only comprises one disk. When the cache layer attempt to set up one cache device on the secondary cache, the cache layer will ignore the cache device if the disks thereon are unavailable. Afterwards, the cache layer will remove the corresponding record of the cache device from the database.

Cache devices in the cache may also fail during normal system operation. The hardware management layer notices this failure first and informs the cache layer. When the cache layer receives an indication that the cache device subordinate to the cache layer has failed, the failed cache device is immediately removed from the secondary cache if the device in the secondary cache is instructed to fail. The storage space allocated for the failed cache device is first released and the user data logic unit and the metadata logic unit establish on the cache device are then removed. Finally, the cache layer will remove the corresponding record for the cache device from the database. When the failed disk is recovered, the hard disk management layer reuses it as a hot spare disk.

FIG. 9 illustrates a block diagram of a device 900 for establishing a multi-tier flash cache according to embodiments of the present disclosure. The apparatus 900, for example, can implement the method 400 shown in FIG. 4. According to FIG. 9, the apparatus 900 can also comprise a first determination unit 910 configured to in response to receiving an I/O request, determine whether there is a free page in a main cache. The apparatus 900 can also comprise a first establishment unit 920 configured to in response to determining that there is no free page in the main cache, establish a secondary cache by selecting at least one spare drive from spare drives in a storage pool. The apparatus 900 can further comprise a first flushing unit 930 configured to flush data from a cold page in the main cache to the secondary cache, an access frequency of the cold page being lower than a predetermined threshold. Further, the apparatus 900 can comprise a first write unit 940 configured to write data related to the I/O request from a persistent storage device to the cold page.

For the purpose of being clear, FIG. 9 does not illustrate some optional modules of the device 900. However, it should be understood that various features described above by FIGS. 3-8 are also applicable to the device 900. Besides, the various modules of the device 900 can be hardware modules as well as software modules. For example, in some embodiments, the device 900 can be implemented partially or fully by the software and/or firmware, such as being implemented as computer program product included on the computer-readable medium. Alternatively or additionally, the device 900 can be implemented fully or partially based on the hardware, such as implemented as integrated circuit (IC), application-specific integrated circuit (ASIC), system-on-chip (SOC), field programmable gate array (FPGA) and the like. The scope of the present disclosure is not restricted in this regard.

FIG. 10 illustrates a schematic block diagram of a device 1000 for implementing embodiments of the present disclosure. As shown in FIG. 10, the device 1000 comprises a central process unit (CPU) 1001, which can execute various suitable actions and processing based on the computer program instructions stored in the read-only memory (ROM) 1002 or computer program instructions loaded in the random-access memory (RAM) 1003. The RAM 1003 can also store all kinds of programs and data required by the operation of the device 1000. CPU 1001, ROM 1002 and RAM 1003 are connected to each other via a bus 1004. The input/output (I/O) interface 1005 is also connected to the bus 1004.

A plurality of components in the device 1000 is connected to the I/O interface 1005, including: an input unit 1006, such as keyboard, mouse and the like; an output unit 1007, e.g., various kinds of display and loudspeakers etc.; a storage unit 108, such as disk and optical disk etc.; and a communication unit 1009, such as network card, modem, wireless transceiver and the like. The communication unit 1009 allows the device 1000 to exchange information/data with other devices via the computer network, such as Internet, and/or various telecommunication networks.

The above described procedure and processing, such as the method 400, can be executed by the processing unit 1001. For example, in some embodiments, the method 400 can be implemented as a computer software program tangibly included in the machine-readable medium, e.g., storage unit 1008. In some embodiments, the computer program can be partially or fully loaded and/or mounted to the apparatus 1000 via ROM 1002 and/or communication unit 1009. When the computer program is loaded to RAM 1003 and executed by the CPU 1001, one or more actions of the above describe method 400 can be implemented.

In conclusion, the embodiments of the present disclosure provide a method for establishing a multi-tier flash cache using spare drives. Compared with the prior art, embodiments of the present disclosure can employ all types of spare drives to establish the secondary cache, so that the spare drives are utilized more effectively. In this way, the cache can be provided with more cache capacity. In addition, it is possible to reduce the write I/O request caused by promoting the page flushed to the hard disk to the flash disk again, so it is possible to extend the service life of the flash disk in the main cache.

The present disclosure can be a method, a device and/or a computer program product. The computer program product can comprise computer-readable storage medium loaded with computer-readable program instructions thereon for executing various aspects of the present disclosure.

The computer-readable storage medium can be a tangible device capable of maintaining and storing instructions used by the instruction executing devices. The computer-readable storage medium may include but is not limited to, for example an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device or any suitable combination of the above. More specific examples (non-exhaustive list) of the computer-readable storage medium comprises the following: a portable storage disk, a hard disk, a random-access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash), a static random-access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, floppy disk, a mechanic coding device, e.g., a punched card or embossment within a groove stored with instructions thereon, and any suitable combinations of the above. The computer-readable storage medium used herein is not interpreted as transient signal per se, e.g., radio waves or freely propagated electromagnetic waves, electromagnetic waves propagated via waveguide or other transmission medium (e.g., optical pulse through a optic fiber cable), or electric signals transmitted through an electric wire.

Computer-readable program instructions described herein can be downloaded to respective computing/processing device from a computer readable storage medium, or to an external computer or external storage device via networks, e.g., Internet, local area network, wide area network and/or wireless network. The network can comprise copper transmission cables, optic fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions to store in the computer-readable storage medium within the respective computing/processing device.

Computer program instructions for carrying out operations of the present disclosure may be assembly instructions, instructions of instruction set architecture (ISA), machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source codes or target codes written in any combinations of one or more programming languages, wherein the programming languages comprise object-oriented programming languages, e.g., Smalltalk, C++ and so on, and conventional procedural programming languages, such as “C” language or similar programming languages. The computer-readable program instructions can be implemented fully on the user computer, partially on the user computer, as an independent software package, partially on the user computer and partially on the remote computer, or completely on the remote computer or server. In the case where remote computer is involved, the remote computer can be connected to the user computer via any type of networks, including local area network (LAN) and wide area network (WAN), or to the external computer (for example, via Internet using the Internet service provider). In some embodiments, state information of the computer-readable program instructions is used to customize an electronic circuit, for example, programmable logic circuit, field programmable gate array (FPGA) or programmable logic array (PLA). The electronic circuit can execute computer-readable program instructions to implement various aspects of the present disclosure.

Various aspects of the present disclosure are described herein with reference to flowchart and/or block diagram of method, apparatus (device) and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowchart and/or block diagram and the combination of each block in the flowchart and/or block diagram can be implemented by computer-readable program instructions.

These computer-readable program instructions may be provided to the processor of general-purpose computer, dedicated computer or other programmable data processing apparatuses to produce a machine, such that the instructions that, when executed by the processor of the computer or other programmable data processing apparatuses, generate an apparatus for implementing functions/actions stipulated in one or more blocks in the flowchart and/or block diagram. The computer-readable program instructions can also be stored in the computer-readable storage medium and cause the computer, programmable data processing apparatus and/or other devices to work in a particular manner, such that the computer-readable medium stored with instructions comprises an article of manufacture, including instructions for implementing various aspects of the functions/actions as specified in one or more blocks of the flowchart and/or block diagram.

The computer-readable program instructions can also be loaded into computer, other programmable data processing apparatuses or other devices, so as to execute a series of operation steps on the computer, other programmable data processing apparatuses or other devices to generate a computer-implemented procedure. Therefore, the instructions executed on the computer, other programmable data processing apparatuses or other devices implement functions/actions stipulated in one or more blocks of the flowchart and/or block diagram.

The flowchart and block diagram in the drawings illustrate architecture, functions and operations implemented by method, device and computer program product according to multiple embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram can represent a module, a part of program segment or instruction, wherein the module and the part of program segment or instruction include one or more executable instructions for performing stipulated logic functions. In some alternative implementations, the functions indicated in the block diagram can also take place in an order different from the one indicated in the drawings. For example, two successive blocks may, in fact, be executed in parallel or in a reverse order dependent on the involved functions. It should also be noted that each block in the block diagram and/or flowchart and combinations of the blocks in the block diagram and/or flowchart can be implemented by a hardware-based system dedicated for executing stipulated functions or actions, or by a combination of dedicated hardware and computer instructions.

The descriptions of various embodiments of the present disclosure have been described above and the above description is only exemplary rather than exhaustive and is not limited to the embodiments of the present disclosure. Many modifications and alterations, without deviating from the scope and spirit of the explained various embodiments, are obvious for those skilled in the art. The selection of technical terms in the text aims to best explain principles and actual applications of each embodiment and technical improvements made in the market by each embodiment, or enable those ordinary skilled in the art to understand the embodiments disclosed herein. 

1. A computer-implemented method, comprising: in response to receiving an I/O request, determining whether there is a free page in a main cache of cache; in response to determining that there is no free page in the main cache, establishing a secondary cache by selecting at least one spare drive from spare drives in a storage pool; flushing data from a cold page in the main cache to the secondary cache, an access frequency of the cold page being lower than a predetermined threshold; and writing data related to the I/O request from a persistent storage device to the cold page.
 2. The method of claim 1, wherein establishing the secondary cache comprises: selecting at least one disk of a first type from the spare drives so that the number of writable times per unit time of the at least one disk exceeds a predetermined threshold.
 3. The method of claim 2, wherein establishing the secondary cache comprises: in response to an available capacity of the at least one disk of the first type dropping below a threshold capacity, selecting at least one disk of a second type from the spare drives so that the number of writable times per unit time of the at least one disk is equal to a predetermined threshold.
 4. The method of claim 3, wherein establishing the secondary cache comprises: in response to an available capacity of the at least one disk of the second type dropping below a threshold capacity, selecting at least one disk of a third type from the spare drives so that the number of writable times per unit time of the at least one disk is lower than a predetermined threshold.
 5. The method of claim 1, wherein establishing the secondary cache comprises: allocating a storage space for a disk in the secondary cache to store corresponding metadata.
 6. The method of claim 1, further comprising: in response to a page in the secondary cache being hit by the received I/O request, allocating a free page for the hit page in the main cache; writing data related to the hit page into the allocated free page in the main cache; and releasing the hit page of the secondary cache.
 7. The method of claim 1, further comprising: receiving a request for replacement of a failed disk in the storage pool; and in response to determining that there is no available spare drive in the storage pool for the replacement, releasing at least one disk in the secondary cache, the at least one disk having the same type as the failed disk to be replaced.
 8. The method of claim 7, wherein releasing at least one disk in the secondary cache comprises: releasing a storage space allocated for the at least one disk; and removing user data logic units of the at least one disk.
 9. An electronic apparatus, comprising: at least one processor; and a memory coupled to the at least one processor and comprising instructions stored thereon, wherein the instructions, when executed by the at least one processor, cause the apparatus to perform acts including: in response to receiving an I/O request, determining whether there is a free page in a main cache of cache; in response to determining that there is no free page in the main cache, establishing a secondary cache by selecting at least one spare drive from spare drives in a storage pool; flushing data from a cold page in the main cache to the secondary cache, an access frequency of the cold page being lower than a predetermined threshold; and writing data related to the I/O request from a persistent storage device to the cold page.
 10. The apparatus of claim 9, wherein establishing the secondary cache comprises: selecting at least one disk of a first type from the spare drives so that the number of writable times per unit time of the at least one disk exceeds a predetermined threshold.
 11. The apparatus of claim 10, wherein establishing the secondary cache comprises: in response to an available capacity of the at least one disk of the first type dropping below a threshold capacity, selecting at least one disk of a second type from the spare drives so that the number of writable times per unit time of the at least one disk is equal to a predetermined threshold.
 12. The apparatus of claim 11, wherein establishing the secondary cache comprises: in response to an available capacity of the at least one disk of the second type dropping below a threshold capacity, selecting at least one disk of a third type from the spare drives so that the number of writable times per unit time of the at least one disk is lower than a predetermined threshold.
 13. The apparatus of claim 9, wherein establishing the secondary cache comprises: allocating a storage space for a disk in the secondary cache to store corresponding metadata.
 14. The apparatus of claim 9, wherein the acts further include: in response to a page in the secondary cache being hit by the received I/O request, allocating a free page for the hit page in the main cache; writing data related to the hit page into the allocated free page in the main cache; and releasing the hit page of the secondary cache.
 15. The apparatus of claim 9, wherein the acts further include: receiving a request for replacement of a failed disk in the storage pool; and in response to determining that there is no available spare drive in the storage pool for the replacement, releasing at least one disk in the secondary cache, the at least one disk having the same type as the failed disk to be replaced.
 16. The apparatus of claim 15, wherein releasing at least one disk in the secondary cache comprises: releasing a storage space allocated for the at least one disk; and removing user data logic units of the at least one disk.
 17. A computer-readable medium having instructions stored with thereon which, when executed by at least one processing unit, causing the at least processing unit to be configured to execute a method, the method comprising: in response to determining that there is no free page in the main cache, establishing a secondary cache by selecting at least one spare drives from spare drive in a storage pool; flushing data from a cold page in the main cache to the secondary cache, an access frequency of the cold page being lower than a predetermined threshold; and writing data related to the I/O request from a persistent storage device to the cold page.
 18. The medium of claim 17, wherein establishing the secondary cache comprises: selecting at least one disk of a first type from the spare drives so that the number of writable times per unit time of the at least one disk exceeds a predetermined threshold.
 19. The medium of claim 18, wherein establishing the secondary cache comprises: in response to an available capacity of the at least one disk of the first type dropping below a threshold capacity, selecting at least one disk of a second type from the spare drives so that the number of writable times per unit time of the at least one disk is equal to a predetermined threshold.
 20. The medium of claim 19, wherein establishing the secondary cache comprises: in response to an available capacity of the at least one disk of the second type dropping below a threshold capacity, selecting at least one disk of a third type from the spare drive so that the number of writable times per unit time of the at least one disk is lower than a predetermined threshold. 21-24. (canceled) 